package cn.maihe.elg.operation.model.vo.business;

import cn.maihe.elg.operation.repository.entity.ProjectInfoVo;

import java.math.BigDecimal;
import java.time.Instant;
import java.util.Date;

/**
 * @Description
 * @Author WJH
 * @Date 2021/03/31
 */

public class ListProjectInfoVO extends ProjectInfoVo {
    /**
     * 机构名称
     */
    private String orgName;
    /**
     * 中心名称
     */
    private String centerName;

    // 投标客户查看投标项目
    /**
     * 申请委托状态
     */
    private Integer authStatus;
    /**
     * 受理订单主键ID
     */
    private Long acceptOrderId;
    /**
     * 受理订单号
     */
    private String acceptOrderNo;

    /**
     * 保费金额：保证金千6保底200
     */
    private Long guaranteeFee;

    /**
     * 能否投标：当前时间大于投标截止时间就不能投标
     */
    private Boolean enableBid;

    private String minBidBond;
    private String maxBidBond;
    private String sortColumn;
    private String[] bidOpenTimeRange;

    private String bidBondYuan;

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getCenterName() {
        return centerName;
    }

    public void setCenterName(String centerName) {
        this.centerName = centerName;
    }

    public Integer getAuthStatus() {
        return authStatus;
    }

    public void setAuthStatus(Integer authStatus) {
        this.authStatus = authStatus;
    }

    public Long getAcceptOrderId() {
        return acceptOrderId;
    }

    public void setAcceptOrderId(Long acceptOrderId) {
        this.acceptOrderId = acceptOrderId;
    }

    public Long getGuaranteeFee() {
        if (this.getBidBond() != null) {
            guaranteeFee = new BigDecimal(this.getBidBond()).multiply(new BigDecimal("0.006")).longValue();
            guaranteeFee = guaranteeFee < 20000 ? 20000 : guaranteeFee;
        }
        return guaranteeFee;
    }

    public void setGuaranteeFee(Long guaranteeFee) {
        this.guaranteeFee = guaranteeFee;
    }

    public String getAcceptOrderNo() {
        return acceptOrderNo;
    }

    public void setAcceptOrderNo(String acceptOrderNo) {
        this.acceptOrderNo = acceptOrderNo;
    }

    public Boolean getEnableBid() {
        if (this.getBidIndate() != null && this.getBidIndate().after(Date.from(Instant.now()))) {
            this.enableBid = true;
        }else{
            this.enableBid = false;
        }
        return this.enableBid;
    }

    public void setEnableBid(Boolean enableBid) {
        this.enableBid = enableBid;
    }

    public String getMinBidBond() {
        return minBidBond;
    }

    public void setMinBidBond(String minBidBond) {
        this.minBidBond = minBidBond;
    }

    public String getMaxBidBond() {
        return maxBidBond;
    }

    public void setMaxBidBond(String maxBidBond) {
        this.maxBidBond = maxBidBond;
    }

    public String getSortColumn() {
        return sortColumn;
    }

    public void setSortColumn(String sortColumn) {
        this.sortColumn = sortColumn;
    }

    public String[] getBidOpenTimeRange() {
        return bidOpenTimeRange;
    }

    public void setBidOpenTimeRange(String[] bidOpenTimeRange) {
        this.bidOpenTimeRange = bidOpenTimeRange;
    }

    public String getBidBondYuan() {
        return bidBondYuan;
    }

    public void setBidBondYuan(String bidBondYuan) {
        this.bidBondYuan = bidBondYuan;
    }
}
